package com.platform.metamodel;

import org.apache.metamodel.schema.SuperColumnType;

/**
 * 根据字符串泛型获取字段超类
 * @author Tommy
 * @create 2021/7/19 9:51
 */
public class ColumnSupTypeUtil {
    public final static String STRING_TYPE = "STRING";
    public final static String NUMBER_TYPE = "NUMBER";
    public final static String DATE_TYPE   = "DATE";
    public final static String BOOL_TYPE   = "BOOLEAN";
    public final static String BYTES_TYPE  = "BYTES";
    public final static String OBJECT_TYPE = "OBJECT";

    public static SuperColumnType getColumnSupType(String genType){
        switch (genType) {
            case NUMBER_TYPE:
                return SuperColumnType.NUMBER_TYPE;
            case DATE_TYPE:
                return SuperColumnType.TIME_TYPE;
            case BOOL_TYPE:
                return SuperColumnType.BOOLEAN_TYPE;
            case BYTES_TYPE:
                return SuperColumnType.BINARY_TYPE;
            case OBJECT_TYPE:
                return SuperColumnType.OTHER_TYPE;
            default:
                return SuperColumnType.LITERAL_TYPE;
        }
    }
}
